fix(security): close comment IDOR, unify lockout policy, extend CSRF …#101
Merged
Conversation
…and harden presence hub Audit-driven fixes after a full-project security review: - Collaboration: UpdateComment now authorizes against live task access (ITaskAccessService) like Add/Delete/Get, closing an IDOR where a former collaborator could still edit a comment after losing task access. - Auth: LockAccount is parameterized and both the failed-attempt threshold and lockout duration are driven from SecurityConstants.SecurityPolicies, removing the hardcoded 15m/>=5 values that diverged from the documented 30m/5 policy. - Todo/Category/Messaging/Collaboration: enforce the double-submit CSRF check (gRPC exempt) to match the documented security model; Realtime excluded due to SignalR negotiate. - Realtime: PresenceHub.UpdateStatus validates status against an allow-list to stop arbitrary/unbounded broadcast payloads. Adds docs/security-audit-2026-06.md recording findings, fixes, and the items assessed as acceptable or false positives. Updates affected unit tests and adds a regression test for the comment access check.
4Keyy
added a commit
that referenced
this pull request
Jun 13, 2026
…t client PR #101 extended UseCsrfProtection() to the business services (Todo, Category, Messaging, Collaboration), so TodoApi now rejects state-changing requests without a matching X-CSRF-Token header + XSRF-TOKEN cookie. The ErrorHandlingTests integration client posted neither, so every POST/PUT/ DELETE started returning 403 and 17 tests failed in CI. The authenticated test client now attaches a matching CSRF header/cookie pair (a real browser supplies both), so the requests pass through the genuine CSRF middleware — which is still fully exercised — instead of being rejected. All 78 ErrorHandlingTests pass again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4Keyy
added a commit
that referenced
this pull request
Jun 13, 2026
The CI 'Lint Markdown' (markdownlint-cli2) job was failing on: MD032 (blanks-around-lists) for the new 'Quote visibility' list in docs/features.md, and MD022 (blanks-around-headings) for the four finding headings in docs/security-audit-2026-06.md (added by #101). Added the required surrounding blank lines. markdownlint-cli2 over the CI globs now reports 0 errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…and harden presence hub
Audit-driven fixes after a full-project security review:
Adds docs/security-audit-2026-06.md recording findings, fixes, and the items assessed as acceptable or false positives. Updates affected unit tests and adds a regression test for the comment access check.
What does this PR do?
Type of change
Related issue
Closes #
Testing
dotnet test Planora.sln)npm run lint && npm run type-check)npm run test)Checklist
.env.exampleupdated if new env vars were added## Unreleased